tg-me.com/java_quizes/217
Create:
Last Update:
Last Update:
🕕 Задача по Java: Что будет выведено?
public class Main {
public static void main(String[] args) {
Integer a = 127;
Integer b = 127;
Integer c = 128;
Integer d = 128;
System.out.println(a == b); // ?
System.out.println(c == d); // ?
}
}
Варианты:
A) true, true
B) true, false
C) false, true
D) false, false
✅ Правильный ответ:
Объяснение:
Java кэширует объекты Integer в диапазоне -128 ... 127.
a == b
c == d
BY Java tests
Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283
Share with your friend now:
tg-me.com/java_quizes/217